const { defineConfig } = require("@vue/cli-service");

const path = require("path");
function resovle(dir) {
  return path.join(__dirname, dir);
}

module.exports = defineConfig({
  transpileDependencies: true,
  //静态资源目录
  assetsDir: "static",
  lintOnSave: false, //取消ESlint校验
  ////相对路径别名配置 使用@代替src
  configureWebpack: {
    resolve: {
      alias: {
        "@": resovle("src"),
      },
    },
  },
  devServer: {
    open: true,
    host: "localhost",
    port: 8081,
    https: false,
    // 代理
    proxy: {
      "/api": {
        target: "http://127.0.0.1:3001",
        ws: true,
        changeOrigin: true,
      },
    },
  },
});
